<?php
/**
 * Copyright (C), 2016-2018, Shall Buy Life info. Co., Ltd.
 * FileName:Example.php
 * Description: 说明
 *
 * @author
 * @Create Date    2021/6/9 14:52
 * @Update Date    2021/6/9 14:52 By drx
 * @version v1.0
 */

namespace Example\Models;

use Example\Filters\QueryFilter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Example extends BasicModel
{

    use SoftDeletes;

    public function __construct(array $attributes = [])
    {
        $this->_name = $this ;
        parent::__construct($attributes);
    }

    /**
     * @var string
     */
    protected $table = 'examples';

    /**
     * @var string[]
     */
    protected $fillable = [
        'id',
        'title',
        'created_at',
        'updated_at',
        'deleted_at'
    ];

    /**
     * FunctionName：scopeFilter
     * Description：过滤
     * Author：lwl
     * @param $query
     * @param QueryFilter $filters
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function scopeFilter($query, QueryFilter $filters)
    {
        return $filters->apply($query);
    }
}
